<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/base.jsp"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/admin.css">
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		//重新绑定表单提交
		$("#add_btn").bind("click", function() {
			$('form').submit();
		});

		chooseGroup();
	});
	//选择不同的村组
	function chooseGroup(){
		var val=$("#village").val();
		$.ajax({
			   type: "POST",
			   url: "<%=path%>/system/area/groupList",
			   data: {"villageId":val},
			   dataType:"json",
			   success: function(data){
				 $("#group").empty();
			     $.each(data,function(i,val){
			    	 $("#group").append("<option value='"+val.areaCode+"'>"+val.areaName+"</option>");
			     });
			   }
			});
	}
</script>

</head>

<body>

	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>增加家庭档案</strong>
		</div>
		<div class="body-content">
			<form id="form-add" method="post" 
				action="<%=path%>/biz/family/add">
				<input type="hidden" name="town" value="${agenCode}"/>
				<div class="form-x">
				<div class="form-group">
					<div class="label">
						<label>所在村：</label>
					</div>
					<div class="field">
						<select id="village" name="village" class="input w50"
							onchange="chooseGroup();">
							<c:forEach items="${list}" var="i">
							<option value="${i.areaCode}">${i.areaName}</option>
							</c:forEach>
						</select>
						<div class="tips"></div>
					</div>
				</div>
					<div class="form-group">
						<div class="label">
							<label>所在组：</label>
						</div>
						<div class="field">
							<select id="group" name="groupno" class="input w50">
								<option value="">请选择所在组</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>户属性：</label>
						</div>
						<div class="field">
							<select id="housePro" name="housepro" class="input w50">
								<option value="1">一般户</option>
								<option value="2">五保户</option>
								<option value="3">军烈属</option>
								<option value="9">其他</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>户主姓名：</label>
						</div>
						<div class="field">
							<input type="text" id="persname" name="persName" value="" class="input w50"/>
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>身份证号：</label>
						</div>
						<div class="field">
							<input type="text" id="cardID" name="cardId" value="" class="input w50"/>
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>出生年月：</label>
						</div>
						<div class="field">
							<input type="text" id="birthday" name="birthday" value="" class="input w50"/>
							<div class="tips"></div>
						</div>
					</div>
					
					<div class="form-group">
						<div class="label">
							<label>性别：</label>
						</div>
						<div class="field">
							<select id="sex" name="sex" class="input w50">
								<option value="1">男</option>
								<option value="2">女</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>人员属性：</label>
						</div>
						<div class="field">
							<select id="persPro" name="persPro" class="input w50">
								<option value="1">一般户</option>
								<option value="2">民政救助对象</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>是否农村户口：</label>
						</div>
						<div class="field">
							<select id="isRural" name="isRural" class="input w50">
								<option value="true">是</option>
								<option value="false">否</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>职业：</label>
						</div>
						<div class="field">
							<select id="occupation" name="occupation" class="input w50">
								<option value="1">农民</option>
								<option value="2">工人</option>
								<option value="3">学生</option>
								<option value="9">其他</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>工作单位：</label>
						</div>
						<div class="field">
							<input type="text" id="workUnit" name="workUnit" class="input w50">	
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>常住地址：</label>
						</div>
						<div class="field">
							<input type="text" id="liveAddress" name="liveAddress" class="input w50">
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>联系电话：</label>
						</div>
						<div class="field">
							<input type="text" id="telephone" name="telephone" value="" class="input w50">
							<div class="tips"></div>
						</div>
					</div>
					
					<div class="form-group">
						<div class="label">
							<label></label>
						</div>
						<div class="field">
							<button id="add_btn" class="button bg-main icon-check-square-o"
								type="button">提交</button>
						</div>
					</div>
					</div>
			</form>
		</div>
	</div>

</body>
</html>
